/*
 * @Author: your name
 * @Date: 2020-08-19 14:26:18
 * @LastEditTime: 2020-09-01 14:58:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \react-hkzf-mobile\src\api\axios.js
 */
// 引入axios实例对象
import service from "../utils/request";

// 首页===============轮播图
export const getSwiperApi = () => {
    return service({
        method: 'GET',
        url: '/home/swiper'
    })
}


// 首页===============租房小组
export const getGroupsApi = (parmas) => {
    return service({
        method: 'GET',
        url: '/home/groups',
        parmas
    })
}


// 首页===============定位
export const getAddressApi = (name) => {
    return service({
        method: 'GET',
        url: '/area/info',
        params: {
            name
        }
    })
}

// 获取城市列表数据
export const getAreaCityApi = (level = 1) => {
    return service({
        method: 'GET',
        url: '/area/city',
        params: {
            level
        }
    })
}

// 获取热门城市
export const getAreaHotApi = () => {
    return service({
        method: 'GET',
        url: '/area/hot',
    })
}

// 获取房源信息
export const getAreaMapApi = (id) => {
    return service({
        method: 'GET',
        url: '/area/map',
        params: {
            id
        }
    })
}


// 获取小区房源信息
export const getHousesApi = (params) => {
    return service({
        method: 'GET',
        url: '/houses',
        params
    })
}


// 获取房屋查询条件
export const getHousesConditionApi = (id) => {
    return service({
        method: 'GET',
        url: '/houses/condition',
        params: {
            id
        }
    })
}


// 获取房源详情
export const getHouseInfoApi = (id) => {
    return service({
        method: 'GET',
        url: `/houses/${id}`
    })
}


// 登录请求
export const getLoginApi = (data) => {
    return service({
        method: 'POST',
        url: `/admin/login`,
        data
    })
}

// 过去个人资料

export const getUserInfoApi = () => {
    return service({
        method: 'GET',
        url: `/user`,
    })
}


